package com.example.leo.mycharmingstudent.a0910;

import android.content.BroadcastReceiver;
import android.content.Context;
import android.content.Intent;
import android.net.Uri;
import android.util.Log;

public class LocalReceiver extends BroadcastReceiver{

    private static final String TAG = "LocalReceiver";

    /**
     * onReceive方法执行在主线程，不可以进行耗时操作
     * 耗时操作超过10s，报ANR异常
     *
     * 如果要执行耗时操作，最好的办法，启动Service
     * 不推荐开启线程的方式
     */
    @Override
    public void onReceive(Context context, Intent intent) {
        if (intent != null) {
            String action = intent.getAction();
            Log.e(TAG, "onReceive: " + action);
        }
    }
}
